*** ============================================================
** Title: Regulatory Convergence in the Financial Periphery: How interdependence shapes regulators' decisions
** Authors: Emily Jones and Alexandra O. Zeitz
** Replication file 
*** ============================================================


*** ============================================================
** Set working directory and load complete dataset
cd "/Users/AZeitz/Dropbox/Financial Regulation Research/Outputs/ISQ/Revised/Final manuscript/Replication"

**Load complete dataset
use "AA-workingdata.dta", replace

*** ============================================================
**Create Figure 1:
* Plot of level of Basel II adoption among those countries outside of the Basel Committee in a given year 

*Create count of how many countries each year are not members of the Basel Committee
qbys year: egen count_nonmemb=count(iso) if net_bcbs==0 & bii_index!=.
*Create count of how many non-members in a given year have adopted one component or more
qbys year: egen nr_adopt1=sum(bii_adopt) if net_bcbs==0 & bii_index!=.
*Create count of how many non-members in a given year have adopted two components or more
qbys year: egen nr_adopt2=sum(bii_adopt2) if net_bcbs==0 & bii_index!=.
*Create count of how many non-members in a given year have adopted five components or more
qbys year: egen nr_adopt5=sum(bii_adopt5) if net_bcbs==0 & bii_index!=.
*Create count of how many non-members in a given year have adopted all ten components
qbys year: egen nr_adopt10=sum(bii_adopt10) if net_bcbs==0 & bii_index!=.
*Calculate percentages
gen pct_adopt1=nr_adopt1/count_nonmemb
gen pct_adopt2=nr_adopt2/count_nonmemb
gen pct_adopt5=nr_adopt5/count_nonmemb
gen pct_adopt10=nr_adopt10/count_nonmemb
*Label variables
label variable pct_adopt1 "One component or more"
label variable pct_adopt2 "Two or more components"
label variable pct_adopt5 "Five or more components"
label variable pct_adopt10 "All ten components"
twoway line pct_adopt1 pct_adopt2 pct_adopt5 pct_adopt10 year if year>2003 & year<2015, xline(2008) scheme(s2mono) ///
		graphregion(color(white)) ytitle("% of jurisdictions outside Basel Committee adopting Basel II", size(small)) ///
		xtitle("Year", size(small)) ylabel(, labsize(small)) xlabel(, labsize(small)) legend(size(small))
graph export figure1.eps, as(eps) replace

*** ============================================================
** Create Table 1:
* Summary statistics

*For the entire panel*
*Drop unnecessary years and observations
keep if year>2005 & year<2015 & net_bcbs==0 & bii_index!=.
drop rf07* st07* sov07* net07* trade07* rfnB* stnB* sovnB* netnB* tradenB* rf12* st12* sov12* net12* trade12* rf12nB* st12nB* sov12nB* net12nB* trade12nB*
*Summarize variables for full panel
outreg2 using sum1.doc, replace sum(log) fmt(fc) label keep(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) eqkeep(mean sd N) ///
		sortvar(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)

*For the 2008 cross-section*
tsset iso year
*Select observations from the 2008 model
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region if net_bcbs==0 & year==2008, robust
keep if e(sample)
*Summarize variables from 2008 cross-section
outreg2 using sum1.doc, sum(log) fmt(fc) label keep(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) eqkeep(mean sd min max N) ///
		sortvar(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)

*For the 2013 cross-section*
use "AA-workingdata.dta", replace 
*Select observations from the 2008 model
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region if net_bcbs==0 & year==2013, robust	
keep if e(sample)
drop rf07* st07* sov07* net07* trade07* rfnB* stnB* sovnB* netnB* tradenB* rf12* st12* sov12* net12* trade12* rf12nB* st12nB* sov12nB* net12nB* trade12nB*
*Summarize variables from 2013 cross-section
outreg2 using sum1.doc, sum(log) fmt(fc) label keep(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) eqkeep(mean sd min max N) ///
		sortvar(bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin ///
		Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)		


*** ============================================================
** Main analysis

**Table 2: 2008 cross-section
*Load data
use "AA-workingdata.dta", replace
*Keep only observations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2008
*Spatial lags individually: receiving foreign banks
reg bii_index Lreceiveforeign_wght_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: banks abroad
reg bii_index Lsendingabroad_wght_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: network membership
reg bii_index Lnetwork_spw_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: sovereign credit rating
reg bii_index Lsovrating_spw_same Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: trade "placebo"
reg bii_index Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags + trade "placebo"
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2008.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)


**Table 2: 2013 cross-section
*Load data
use "AA-workingdata.dta", replace
*Keep only obesrvations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2013
*Spatial lags individually: receiving foreign banks
reg bii_index Lreceiveforeign_wght_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: banks abroad
reg bii_index Lsendingabroad_wght_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: network membership
reg bii_index Lnetwork_spw_bin Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: sovereign credit rating
reg bii_index Lsovrating_spw_same Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: trade "placebo"
reg bii_index Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags + trade "placebo"
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using main2013.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
 
*** ============================================================
** Appendix
*** ============================================================



*** ============================================================
*Table A1: Pattern of adoption of Basel II components in 2008
use "AA-workingdata.dta", replace
keep if year==2008 & net_bcbs==0

tab bii_index
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==1
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==2
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==3
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==4
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==5
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==6
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==7
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==8
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==9


*Table A2: Pattern of adoption of Basel II components in 2013
use "AA-workingdata.dta", replace
keep if year==2013 & net_bcbs==0

tab bii_index
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==1
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==2
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==3
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==4
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==5
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==6
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==7
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==8
tab1 bii_sa_imp bii_firb_imp bii_airb_imp bii_bia_imp bii_tsa_imp bii_ama_imp bii_smm_imp bii_im_imp bii_pillarii_imp bii_pillariii_imp if bii_index==9

*** ============================================================
*Table A3: 2008 cross-section, with continuous connectivity matrices, rather than binary link between countries
*Load data
use "AA-workingdata.dta", replace
*Keep only obesrvations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2008
*Spatial lags individually: receiving foreign banks
reg bii_index Lreceiveforeign_wght_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: banks abroad
reg bii_index Lsendingabroad_wght_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: network membership
reg bii_index Lnetwork_spw_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: sovereign ratings
reg bii_index Lsovrating_spw_rat Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: trade "placebo"
reg bii_index Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*All spatial lags
reg bii_index Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*All spatial lags + trade "placebo"
reg bii_index Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app3.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)

*Table A4: 2013 cross-section, with continuous connectivity matrices, rather than binary link between countries
*Load data
use "AA-workingdata.dta", replace
*Keep only obesrvations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2013
*Spatial lags individually: receiving foreign banks
reg bii_index Lreceiveforeign_wght_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: banks abroad
reg bii_index Lsendingabroad_wght_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: network membership
reg bii_index Lnetwork_spw_ind Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: sovereign ratings
reg bii_index Lsovrating_spw_rat Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*Spatial lags individually: trade "placebo"
reg bii_index Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*All spatial lags
reg bii_index Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)
*All spatial lags + trade "placebo"
reg bii_index Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app4.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_ind Lsendingabroad_wght_ind Lnetwork_spw_ind Lsovrating_spw_rat Ltradetogdp_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr)

*** ============================================================
**Table A5: Additional domestic controls: 2008 and 2013
*Load data
use "AA-workingdata.dta", replace

*2008*
keep if year==2008 & net_bcbs==0
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app5.doc, replace dec(3) sdec(3) ctitle(" ") label drop(ib3.region) sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i) addtext(Region dummies, YES)
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i ib3.region, robust
outreg2 using app5.doc, dec(3) sdec(3) ctitle(" ") label drop(ib3.region) sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i) addtext(Region dummies, YES)
*2013*
use "AA-workingdata.dta", replace
keep if year==2013 & net_bcbs==0
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app5.doc, dec(3) sdec(3) ctitle(" ") label drop(ib3.region) sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i) addtext(Region dummies, YES)
reg bii_index Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i ib3.region, robust
outreg2 using app5.doc, dec(3) sdec(3) ctitle(" ") label drop(ib3.region) sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same Ltradebin30_wght Llgdppc Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr Lbrss_govbanks_i brss_crar_i Lregulatory_quality1 Lsup_banks Lsup_power1 Lovr_cap_string1 Laccounting_practices1 Lprivatemonitoring1 doi_ecr_i) addtext(Region dummies, YES)

*** ============================================================
** GMM models **

*Table A6: Spatial-GMM model of extent of Basel II adoption in 2008, estimation sample expanded to include Basel Committee Members
*Keep 2008 and only relevant observations
use "AA-workingdata.dta", replace
keep if year==2008
drop year
drop if rf07_1==.

*spset the data for spatial analysis. iso is the unit identifier.
xtset, clear
spset, clear
spset iso

*Generate a spatial matrix of the links created through the *entry of foreign banks*
spmatrix fromdata Wfbanks = rf07_1 - rf07_119, replace
*Generate a spatial matrix of the links created through *domestic banks going abroad*
spmatrix fromdata Wbankabroad = st07_1 - st07_119, replace
*Generate a spatial matrix of the links created through *competition for capital* 
spmatrix fromdata Wsovsame = sov07_1 - sov07_119, replace
*Generate a spatial matrix of the links created through *joint network membership* (measured as any shared network membership)
spmatrix fromdata Wsamenet = net07_1 - net07_119, replace
*Generate a spatial matrix of the links created through *trade* 
spmatrix fromdata Wtrade = trade07_1 - trade07_119, replace
*Drop the variables used to create the spatial matrices
drop rf07_* st07_* sov07_* net07_* trade07_*

*Run models
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) errorlag(Wfbanks) force
outreg2 using app6.doc, replace dec(3) sdec(3) ctitle(" ") drop(ib3.region) label onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wbankabroad) errorlag(Wbankabroad) force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsamenet) errorlag(Wsamenet) force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsovsame) errorlag(Wsovsame) force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wtrade) errorlag(Wtrade) force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) dvarlag(Wtrade) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  errorlag(Wtrade) force
outreg2 using app6.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)

******

*Table A7: Spatial-GMM model of extent of Basel II adoption in 2008, estimation sample shrunk to include only those outside the Basel committee
*Keep 2008 and only relevant observations
use "AA-workingdata.dta", replace
keep if year==2008
drop year
drop if rfnB07_1==.

*spset the data for spatial analysis. iso is the unit identifier.
xtset, clear
spset, clear
spset iso

*Generate a spatial matrix of the links created through the *entry of foreign banks*
spmatrix fromdata Wfbanks = rfnB07_1 - rfnB07_107, replace
*Generate a spatial matrix of the links created through *domestic banks going abroad*
spmatrix fromdata Wbankabroad = stnB07_1 - stnB07_107, replace
*Generate a spatial matrix of the links created through *competition for capital* 
spmatrix fromdata Wsovsame = sovnB07_1 - sovnB07_107, replace
*Generate a spatial matrix of the links created through *joint network membership* (measured as any shared network membership)
spmatrix fromdata Wsamenet = netnB07_1 - netnB07_107, replace
*Generate a spatial matrix of the links created through *trade* 
spmatrix fromdata Wtrade = tradenB07_1 - tradenB07_107, replace
*Drop the variables used to create the spatial matrices
drop rfnB07_* stnB07_* sovnB07_* netnB07_* tradenB07_*

*Run models
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) errorlag(Wfbanks) force
outreg2 using app7.doc, replace dec(3) sdec(3) ctitle(" ") drop(ib3.region) label onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wbankabroad) errorlag(Wbankabroad) force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsamenet) errorlag(Wsamenet) force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsovsame) errorlag(Wsovsame) force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wtrade) errorlag(Wtrade) force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) dvarlag(Wtrade) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  errorlag(Wtrade) force
outreg2 using app7.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)


******
*Table A8: Spatial-GMM model of extent of Basel II adoption in 2013, estimation sample expanded to include Basel Committee Members

*Keep 2008 and only relevant observations
use "AA-workingdata.dta", replace
keep if year==2013
drop year 
drop if rf12_1==.

*spset the data for spatial analysis. iso is the unit identifier.
xtset, clear
spset, clear
spset iso

*Generate a spatial matrix of the links created through the *entry of foreign banks*
spmatrix fromdata Wfbanks = rf12_1 - rf12_119, replace
*Generate a spatial matrix of the links created through *domestic banks going abroad*
spmatrix fromdata Wbankabroad = st12_1 - st12_119, replace
*Generate a spatial matrix of the links created through *competition for capital* 
spmatrix fromdata Wsovsame = sov12_1 - sov12_119, replace
*Generate a spatial matrix of the links created through *joint network membership* (measured as any shared network membership)
spmatrix fromdata Wsamenet = net12_1 - net12_119, replace
*Generate a spatial matrix of the links created through *trade* 
spmatrix fromdata Wtrade = trade12_1 - trade12_119, replace
*Drop the variables used to create the spatial matrices
drop rf12_* st12_* sov12_* net12_* trade12_*

*Run models
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) errorlag(Wfbanks) force
outreg2 using app8.doc, replace dec(3) sdec(3) ctitle(" ") drop(ib3.region) label onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wbankabroad) errorlag(Wbankabroad) force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsamenet) errorlag(Wsamenet) force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsovsame) errorlag(Wsovsame) force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wtrade) errorlag(Wtrade) force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) dvarlag(Wtrade) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  errorlag(Wtrade) force
outreg2 using app8.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)


******

*Table A9: Spatial-GMM model of extent of Basel II adoption in 2008, estimation sample shrunk to include only those outside the Basel committee
*Keep 2013 and only relevant observations
use "AA-workingdata.dta", replace
keep if year==2013
drop year
drop if rf12nB_1==.

*spset the data for spatial analysis. iso is the unit identifier.
xtset, clear
spset, clear
spset iso

*Generate a spatial matrix of the links created through the *entry of foreign banks*
spmatrix fromdata Wfbanks = rf12nB_1 - rf12nB_76, replace
*Generate a spatial matrix of the links created through *domestic banks going abroad*
spmatrix fromdata Wbankabroad = st12nB_1 - st12nB_76, replace
*Generate a spatial matrix of the links created through *competition for capital* 
spmatrix fromdata Wsovsame = sov12nB_1 - sov12nB_76, replace
*Generate a spatial matrix of the links created through *joint network membership* (measured as any shared network membership)
spmatrix fromdata Wsamenet = net12nB_1 - net12nB_76, replace
*Generate a spatial matrix of the links created through *trade* 
spmatrix fromdata Wtrade = trade12nB_1 - trade12nB_76, replace
*Drop the variables used to create the spatial matrices
drop rf12nB_* st12nB_* sov12nB_* net12nB_* trade12nB_*

*Run models
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) errorlag(Wfbanks) force
outreg2 using app9.doc, replace dec(3) sdec(3) ctitle(" ") drop(ib3.region) label onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wbankabroad) errorlag(Wbankabroad) force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsamenet) errorlag(Wsamenet) force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wsovsame) errorlag(Wsovsame) force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wtrade) errorlag(Wtrade) force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)
spregress bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr ib3.region, gs2sls dvarlag(Wfbanks) dvarlag(Wbankabroad) dvarlag(Wsamenet) dvarlag(Wsovsame) dvarlag(Wtrade) errorlag(Wfbanks) errorlag(Wbankabroad) errorlag(Wsamenet) errorlag(Wsovsame)  errorlag(Wtrade) force
outreg2 using app9.doc, label dec(3) sdec(3) ctitle(" ") drop(ib3.region) onecol sortvar(bii_index Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 imf_iiiyr) addtext(Region dummies, YES)


*** ============================================================
** Models with Basel adoption measured using IRT 

**Table A10: 2008 cross-section
*Load data
use "AA-workingdata.dta", replace
*Keep only obesrvations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2008
*Spatial lags individually: receiving foreign banks
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: banks abroad
reg irt_mean_rs Lsendingabroad_wght_bin_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: network membership
reg irt_mean_rs Lnetwork_spw_bin_nobcg_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: sovereign credit rating
reg irt_mean_rs Lsovrating_spw_same_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: trade "placebo"
reg irt_mean_rs Ltradebin30_wght_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lsendingabroad_wght_bin_irt Lnetwork_spw_bin_nobcg_irt Lsovrating_spw_same_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags + trade "placebo"
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lsendingabroad_wght_bin_irt Lnetwork_spw_bin_nobcg_irt Lsovrating_spw_same_irt Ltradebin30_wght_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app10.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)


**Table A11: 2013 cross-section
*Load data
use "AA-workingdata.dta", replace
*Keep only obesrvations outside the Basel Committee in the 2008 cross-section
keep if net_bcbs==0 & year==2013
*Spatial lags individually: receiving foreign banks
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, replace dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: banks abroad
reg irt_mean_rs Lsendingabroad_wght_bin_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: network membership
reg irt_mean_rs Lnetwork_spw_bin_wbcg_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: sovereign credit rating
reg irt_mean_rs Lsovrating_spw_same_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*Spatial lags individually: trade "placebo"
reg irt_mean_rs Ltradebin30_wght_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lsendingabroad_wght_bin_irt Lnetwork_spw_bin_wbcg_irt Lsovrating_spw_same_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
*All spatial lags + trade "placebo"
reg irt_mean_rs Lreceiveforeign_wght_bin_irt Lsendingabroad_wght_bin_irt Lnetwork_spw_bin_wbcg_irt Lsovrating_spw_same_irt Ltradebin30_wght_irt Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr ib3.region, robust
outreg2 using app11.doc, dec(3) sdec(3) ctitle(" ") label sortvar(Lreceiveforeign_wght_bin Lsendingabroad_wght_bin Lnetwork_spw_bin Lsovrating_spw_same  Ltradebin30_wght Lprivcredit1 Lfdi_in_gdp1 Lpolity Lcpi Lcbiw Lbankcon1 Limf_iiiyr) drop(ib3.region) addtext(Region dummies, Yes)
 



